package cn.laixueit.vo;

/**
 * @author duxiang
 * @date 2023/12/6 15:43
 */

import lombok.Data;

/**
 * 分页类
 */
@Data
public class ResultPage {

    /**
     * 当前页
     */
    private Long current;
    /**
     * 每页显示数量
     */
    private Long size;
    /**
     * 总页数
     */
    private Long pages;

    /**
     *页码数量
     */
    private Integer restrictNum;



    /**
     * 是否存在上一页
     */
    private Boolean isPre;
    public Boolean getIsPre() {
        return current>1;
    }

    /**
     * 是否存在下一页
     */
    private Boolean isNext;
    public Boolean getIsNext() {
        return current < pages;
    }

    /**
     * 分页条
     */
    private Long[] pageNoList;

    public ResultPage(Long current, Long size, Long pages, Integer restrictNum, Long[] pageNoList) {
        this.current = current;
        this.size = size;
        this.pages = pages;
        this.restrictNum = restrictNum;
        this.pageNoList = pageNoList;
    }
}
